package com.zy.web.demo.duoxiancheng.demo15;


/**
 * @author <a href="mailto:zhouyong@cqyyt.com">zy</a>
 * @version 1.0
 * @date 2020/8/17 14:41
 */
public class ThreadA15 extends Thread{
    private Object object;

    public ThreadA15(Object object){
        super();
        this.object = object;
    }

    @Override
    public void run() {
        try {
            synchronized (object) {
                System.out.println(Thread.currentThread().getName() + "，wait开始时间=" + System.currentTimeMillis());
                object.wait();
                System.out.println(Thread.currentThread().getName() + "，wait结束时间=" + System.currentTimeMillis());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }


}
